Function.prototype.myBind = function (context, ...args) {
  context = context || window
  const symbolKey = Symbol('fn')
  context[symbolKey] = this
  return function (..._args) {
    const allArgs = [...args,..._args]
    context[symbolKey](...allArgs)
    delete context[symbolKey]
  }
}

Function.prototype.myCall = function (context, ...args) {
  context = context || window
  const symbolKey = Symbol('fn')
  context[symbolKey] = this
  context[symbolKey](...args)
  delete context[symbolKey]
}

Function.prototype.myApply = function (context, args) {
  context = context || window
  const symbolKey = Symbol('fn')
  context[symbolKey] = this
  context[symbolKey](...args)
  delete context[symbolKey]
}


function fn(name) {
  this.name = name
}

var obj = {}

// fn.myBind(obj,'lilei')()
// fn.myCall(obj,'isMyCall')
fn.myApply(obj,['isMyApply'])
console.log(obj)